//
//  ExpandButton.m
//  TraderWork
//
//  Created by steven on 15/7/6.
//  Copyright (c) 2015年 lwork. All rights reserved.
//  http://my.oschina.net/gejw0623/blog/362303

#import "ExpandButton.h"

@implementation ExpandButton

- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent*)event
{
    CGRect bounds = self.bounds;
    //若原热区小于44x44，则放大热区，否则保持原大小不变
    CGFloat widthDelta = MAX(44.0 - bounds.size.width, 0);
    CGFloat heightDelta = MAX(44.0 - bounds.size.height, 0);
//    CGFloat widthDelta = MAX(100.0 - bounds.size.width, 0);
//    CGFloat heightDelta = MAX(100.0 - bounds.size.height, 0);
    bounds = CGRectInset(bounds,
                         -0.5 * widthDelta,
                         -0.5 * heightDelta);
    return CGRectContainsPoint(bounds, point);
}

@end
